/*
 */
package logistics;

import aptech.eproject.logictics.dao.kien.BookingManagementServiceRemote;
import aptech.logictics.Util;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 *
 * @author Kien Nguyen <solidfoxrock at gmail.com>
 */
public class LogisticsContextListener implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("Initializing context...");
        BookingManagementServiceRemote service = Util.lookupBookingManagementService();
        service.startAgent();
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        System.out.println("Destroying context...");
        BookingManagementServiceRemote service = Util.lookupBookingManagementService();
        service.stopAgent();
    }
}
